<?php
class CV_Unittest_Suite extends TestSuite{
	function collect($path, &$collector = null) {
		if( is_file($path) ){
			$this->addFile( $path );
		}elseif( is_dir($path) ){
			if(empty($collector)){
				$collector = new CV_Unittest_Collector();
			}
			$collector->collect($this, $path);
		}
	}
	function run( $reporter = null ) {
		if( !empty($reporter) ){
			// pass
		}elseif( PHP_SAPI !== "cli" ){ // if not run from command line
			$reporter = new CV_Unittest_Reporter_Html();
		} else {
			$reporter = new CV_Unittest_Reporter_Text();
		}
		return parent::run($reporter);
	}
}